package com.wish.building.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

/**
 * 建筑类型表
 */
public enum BuildingType {
    BOARDFOOR("板楼", 0),
    TOWER("塔楼", 1),
    BOARDCOMBINEDTOWER("板塔结合",2),
    BOTTOM("底层",3),
    MULTILAYER("多层",4),
    HIGHLEVEL("高层", 5);

    @EnumValue
    private String name;

    private Integer index;

    private BuildingType(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (BuildingType c : BuildingType.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

}

